***********************************
*** BVP Pilot Study Recode File ***
***********************************
***      February 25 2019       ***
***********************************

*For use with: BVP_FinalData_040717.dta

*ssc install blindschemes, replace all

set scheme plotplainblind

*******************************
*Recode DVs

*Pol Interest
tab q7
gen pol_interest=q7
recode pol_interest 4/5=0 1/2=5 88=.
recode pol_interest 3=1 5=2
tab pol_interest

*2016 Vote
tab q11
gen vote2016=0
replace vote2016=1 if q11==1
tab vote2016

*2018 Vote
tab q16
gen vote2018=q16
recode vote2018 4/88=0 1=5 3=0 2=3
tab vote2018
gen vote2018collapse=0
replace vote2018collapse=1 if vote2018==5 
tab vote2018collapse

*Signed Petition
gen petition2=q10_1
recode petition2 2/99=0
tab petition2

*Boycotted
gen boycott2=q10_2
recode boycott2 2/99=0
tab boycott2

*Demonstrate
gen demonstrate2=q10_3
recode demonstrate2 2/99=0
tab demonstrate2

*Attend meeting
gen meeting2=q10_4
recode meeting2 2/99=0
tab meeting2

*Contact rep
gen contact2=q10_5
recode contact2 2/99=0
tab contact2

*Donated money
gen donate2=q10_6
recode donate2 2/99=0
tab donate2


*********************************
*Recode Main IDVs

***BLM Measures***
*Identify w/BLM (2=str identify)
tab q27
gen blm_id=q27
recode blm_id 3/4=0 1=3 2=1 88/99=.
recode blm_id 3=2
tab blm_id

*Kaepernick (Q: Based on what you have heard, do you approve or disapprove of Colin Kaepernick's and other NFL players National Anthem protests?)
tab q32
gen Kaep=q32
recode Kaep 3/4=0 1=5 2=3 88/99=88
tab Kaep

gen Kaepnew=Kaep
recode Kaepnew 3=1 5=2 88=.
tab Kaepnew

gen Kaepnew2=Kaepnew
recode Kaepnew2 1=0 2=1
tab Kaepnew2
 
**********************************
*Sociodem & political control vars

*Age
tab q3
gen age=q3
tab age

*South
tab hidstate
gen south=0
replace south=1 if hidstate=="GA" 
replace south=1 if hidstate=="NC"
replace south=1 if hidstate=="VA"
tab south 

*Gender
tab q4
gen female=0
replace female=1 if q4==1
replace female=1 if q4==3
tab female

*Education (hs or less/some college or more) 
tab q5
gen college=q5 
recode college 2/3=0 4/6=1 99=0
tab college 

*Political trust (4=no trust)
tab q60
gen pol_trust=q60
recode pol_trust 88/99=.
tab pol_trust

*Obama Therm
tab q37_10
gen obama_therm=q37_10
recode obama_therm 89=.
tab obama_therm

*Linked-fate (4=NO linked fate)
tab q42
gen linked_fate=q42
recode linked_fate 88/99=.
tab linked_fate

*PTID
tab q48
gen republican=0
replace republican=1 if q48==2
gen indep_other=0
replace indep_other=1 if q48==3
replace indep_other=1 if q48==88
replace indep_other=1 if q48==99
gen democrat=0
replace democrat=1 if q48==1
tab democrat
tab republican
tab indep_other

*Ideology (7=very conservative)
tab q51
gen ideo=q51
recode ideo 88/99=4
tab ideo

*Church attendace (6=never attend)
tab q52
gen church_att=q52
recode church_att 88/99=.
tab church_att

*Married
tab q54
gen married=0
replace married=1 if q54==1
replace married=1 if q54==6
tab married

*Own home
tab q56
gen own_home=0
replace own_home=1 if q56==1
tab own_home

*Income
tab q62
gen income_40K=0
replace income_40K=1 if q62==1
replace income_40K=1 if q62==2
gen income_80K=0
replace income_80K=1 if q62==3
replace income_80K=1 if q62==4
gen income_150K=0
replace income_150K=1 if q62==5
replace income_150K=1 if q62==6
replace income_150K=1 if q62==7
gen income_miss=0
replace income_miss=1 if q62==88
replace income_miss=1 if q62==99
tab income_miss
tab income_40K
tab income_80K
tab income_150K

*Political knowledge
gen knowcon=0
replace knowcon=1 if q57==1
gen knowvp=0
replace knowvp=1 if q58==1
gen seathr=0
replace seathr=1 if q59==2
tab knowcon
tab knowvp
tab seathr

gen pol_know=(knowcon+knowvp+seathr)/3
tab pol_know


*********************************
*Prelim Xtabs

tab blm_id Kaepnew2, col nof chi2

tab vote2016 blm_id, col nof chi2
tab vote2016 Kaepnew2, col nof chi2

tab vote2018collapse blm_id, col nof chi2
tab vote2018collapse Kaepnew2, col nof chi2

tab pol_interest blm_id, col nof chi2
tab pol_interest Kaepnew2, col nof chi2


*********************************
*Prelim models

*tab Kaep_strapprove
*tab Kaep_swapprove
*tab Kaep_disapprove
*tab Kaep_dk

***Political Engagement***


***Interaction variable:
gen kaepblm_interact=(blm_id*Kaepnew)
tab kaepblm_interact 

eststo clear
logit vote2016 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)
eststo
logit vote2016 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust kaepblm_interact, cluster(hidstatezip)
eststo
logit vote2018collapse blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)
eststo
logit vote2018collapse blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust kaepblm_interact, cluster(hidstatezip)
eststo


esttab using BVP_KaepPartic_models, b(2) se(3) star(* 0.10) bic title ("Predicting Political Engagment, by Kaep & BLM Approval") rtf replace

logit vote2016 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)
prvalue, x(blm_id=0) brief
*prvalue, x(blm_id=1) brief
prvalue, x(blm_id=2) brief

prvalue, x(Kaepnew2=0) brief
prvalue, x(Kaepnew2=1) brief

prvalue, x(pol_interest=0) brief
*prvalue, x(pol_interest=1) brief
prvalue, x(pol_interest=2) brief

prvalue, x(college=0) brief
prvalue, x(college=1) brief

logit vote2018collapse blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)
prvalue, x(blm_id=0) brief
*prvalue, x(blm_id=1) brief
prvalue, x(blm_id=2) brief

prvalue, x(Kaepnew2=0) brief
prvalue, x(Kaepnew2=1) brief

prvalue, x(pol_interest=0) brief
*prvalue, x(pol_interest=1) brief
prvalue, x(pol_interest=2) brief

prvalue, x(college=0) brief
prvalue, x(college=1) brief


***
logit vote2016 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K i.Kaepnew2##c.blm_id, cluster(hidstatezip)

*Vote2016=1  
margins Kaepnew2, at(blm_id=(0 1 2)) atmeans noatlegend level(90)
marginsplot, x(blm_id) title(Vote in 2016) ytitle(Predicted Probability) ///
  plot1opts(lpattern("--")) ylabel(.6(.2)1) name(Vote2016, replace) recast(line) ciopt(color(%20)) recastci(rarea) legend(position(6) rows(1)) plotregion(fcolor(white)) graphregion(fcolor(white))
graph save 1.gph, replace  


***
logit vote2018collapse pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K i.Kaepnew2##c.blm_id, cluster(hidstatezip)

*Vote2018=1  
margins Kaepnew2, at(blm_id=(0 1 2)) atmeans noatlegend level(90)
marginsplot, x(blm_id) title(Vote in 2018) ytitle(Predicted Probability) ///
  plot1opts(lpattern("--")) ylabel(.5(.1).9) name(Vote2018collapse, replace) recast(line) ciopt(color(%20)) recastci(rarea) legend(position(6) rows(1)) plotregion(fcolor(white)) graphregion(fcolor(white))
graph save 2.gph, replace


*********************************************
*Breakdown of political engagement acts

*Signed Petition
tab petition
logit petition2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)
prvalue, x(blm_id=0) brief
prvalue, x(blm_id=2) brief

prvalue, x(Kaepnew2=0) brief
prvalue, x(Kaepnew2=1) brief

prvalue, x(pol_interest=0) brief
prvalue, x(pol_interest=2) brief

prvalue, x(college=0) brief
prvalue, x(college=1) brief

*pol_trust high=1 Low=4
prvalue, x(pol_trust=1) brief
prvalue, x(pol_trust=4) brief


*Boycotted
tab boycott
logit boycott2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)
prvalue, x(blm_id=0) brief
prvalue, x(blm_id=2) brief

prvalue, x(Kaepnew2=0) brief
prvalue, x(Kaepnew2=1) brief

prvalue, x(pol_interest=0) brief
prvalue, x(pol_interest=2) brief

prvalue, x(college=0) brief
prvalue, x(college=1) brief

*pol_trust high=1 Low=4
prvalue, x(pol_trust=1) brief
prvalue, x(pol_trust=4) brief


*Demonstrate
tab demonstrate
logit demonstrate2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_80K income_150K pol_trust, cluster(hidstatezip)
prvalue, x(blm_id=0) brief
prvalue, x(blm_id=2) brief

prvalue, x(Kaepnew2=0) brief
prvalue, x(Kaepnew2=1) brief

prvalue, x(pol_interest=0) brief
prvalue, x(pol_interest=2) brief

prvalue, x(college=0) brief
prvalue, x(college=1) brief

*pol_trust high=1 Low=4
prvalue, x(pol_trust=1) brief
prvalue, x(pol_trust=4) brief


*Attend meeting
tab meeting
logit meeting2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_80K income_150K pol_trust, cluster(hidstatezip)
prvalue, x(blm_id=0) brief
prvalue, x(blm_id=2) brief

prvalue, x(Kaepnew2=0) brief
prvalue, x(Kaepnew2=1) brief

prvalue, x(pol_interest=0) brief
prvalue, x(pol_interest=2) brief

prvalue, x(college=0) brief
prvalue, x(college=1) brief

*pol_trust high=1 Low=4
prvalue, x(pol_trust=1) brief
prvalue, x(pol_trust=4) brief


*Contact rep
tab contact
logit contact2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)
prvalue, x(blm_id=0) brief
prvalue, x(blm_id=2) brief

prvalue, x(Kaepnew2=0) brief
prvalue, x(Kaepnew2=1) brief

prvalue, x(pol_interest=0) brief
prvalue, x(pol_interest=2) brief

prvalue, x(college=0) brief
prvalue, x(college=1) brief

*pol_trust high=1 Low=4
prvalue, x(pol_trust=1) brief
prvalue, x(pol_trust=4) brief


*Donated money
tab donate
logit donate2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)
prvalue, x(blm_id=0) brief
prvalue, x(blm_id=2) brief

prvalue, x(Kaepnew2=0) brief
prvalue, x(Kaepnew2=1) brief

prvalue, x(pol_interest=0) brief
prvalue, x(pol_interest=2) brief

prvalue, x(college=0) brief
prvalue, x(college=1) brief

*pol_trust high=1 Low=4
prvalue, x(pol_trust=1) brief
prvalue, x(pol_trust=4) brief


*test for multicollinearity
* vif, uncentered


***
*Regression table code...
eststo clear
logit petition2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)
eststo
logit boycott2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)
eststo
logit demonstrate2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)
eststo
logit meeting2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)
eststo
logit contact2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)
eststo
logit donate2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)
eststo

esttab using BVP_KaepExtraPartic_models, b(2) se(3) star(* 0.10) bic title ("Predicting non-Traditional Political Engagment, by Kaep & BLM Approval") rtf replace

*Tables for interaction models
eststo clear
logit petition2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust kaepblm_interact, cluster(hidstatezip)
eststo
logit boycott2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust kaepblm_interact, cluster(hidstatezip)
eststo
logit demonstrate2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust kaepblm_interact, cluster(hidstatezip)
eststo
logit meeting2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust kaepblm_interact, cluster(hidstatezip)
eststo
logit contact2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust kaepblm_interact, cluster(hidstatezip)
eststo
logit donate2 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust kaepblm_interact, cluster(hidstatezip)
eststo

esttab using BVP_KaepExtraPartic_interactmodels, b(2) se(3) star(* 0.10) bic title ("Predicting non-Traditional Political Engagment Interact, by Kaep & BLM Approval") rtf replace



*Lets graph the interaction!*
logit petition2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K i.Kaepnew2##c.blm_id, level(90) cluster(hidstatezip)
 
margins Kaepnew2, at(blm_id=(0 1 2)) atmeans noatlegend level(90)
marginsplot, x(blm_id) title(Signed Petition) ytitle(Predicted Probability) ///
  plot1opts(lpattern("--")) ylabel(0(.1).6) name(petition, replace) recast(line) ciopt(color(%20)) recastci(rarea) legend(position(6) rows(1)) plotregion(fcolor(white)) graphregion(fcolor(white))
  
  
***
logit boycott2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K i.Kaepnew2##c.blm_id, cluster(hidstatezip)
 
margins Kaepnew2, at(blm_id=(0 1 2)) atmeans noatlegend level(90)
marginsplot, x(blm_id) title(Boycott) ytitle(Predicted Probability) ///
  plot1opts(lpattern("--")) ylabel(0(.1).6) name(boycott, replace) recast(line) ciopt(color(%20)) recastci(rarea) legend(position(6) rows(1)) plotregion(fcolor(white)) graphregion(fcolor(white))

  
***
logit demonstrate2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K i.Kaepnew2##c.blm_id, cluster(hidstatezip)
 
margins Kaepnew2, at(blm_id=(0 1 2)) atmeans noatlegend level(90)
marginsplot, x(blm_id) title(Demonstrate) ytitle(Predicted Probability) ///
  plot1opts(lpattern("--")) ylabel(0(.1).2) name(demonstrate, replace) recast(line) ciopt(color(%20)) recastci(rarea) legend(position(6) rows(1)) plotregion(fcolor(white)) graphregion(fcolor(white))

  
***
logit meeting2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K i.Kaepnew2##c.blm_id, cluster(hidstatezip)
 
margins Kaepnew2, at(blm_id=(0 1 2)) atmeans noatlegend level(80)
marginsplot, x(blm_id) title(Meeting) ytitle(Predicted Probability) ///
  plot1opts(lpattern("--")) ylabel(0(.1).4) name(meeting, replace) recast(line) ciopt(color(%20)) recastci(rarea) legend(position(6) rows(1)) plotregion(fcolor(white)) graphregion(fcolor(white))

  
***
logit contact2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K i.Kaepnew2##c.blm_id, cluster(hidstatezip)
 
margins Kaepnew2, at(blm_id=(0 1 2)) atmeans noatlegend level(90)
marginsplot, x(blm_id) title(Contact) ytitle(Predicted Probability) ///
  plot1opts(lpattern("--")) ylabel(0(.1).4) name(contact, replace) recast(line) ciopt(color(%20)) recastci(rarea) legend(position(6) rows(1)) plotregion(fcolor(white)) graphregion(fcolor(white))

  
***

logit donate2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K i.Kaepnew2##c.blm_id, cluster(hidstatezip)
 
margins Kaepnew2, at(blm_id=(0 1 2)) atmeans noatlegend level(90)
marginsplot, x(blm_id) title(Donate) ytitle(Predicted Probability) ///
  plot1opts(lpattern("--")) ylabel(0(.1).5) name(donate, replace) recast(line) ciopt(color(%20)) recastci(rarea) legend(position(6) rows(1)) plotregion(fcolor(white)) graphregion(fcolor(white))

  
***
*Additional models controlling for action earlier in life...(index)
***

logit petition2 polaction_idx3 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)

logit boycott2 polaction_idx3 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)

logit demonstrate2 polaction_idx3 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)

logit meeting2 polaction_idx3 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)

logit contact2 polaction_idx3 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)

logit donate2 polaction_idx3 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust, cluster(hidstatezip)

*Interaction models
logit petition2 polaction_idx3 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust kaepblm_interact, cluster(hidstatezip)

logit boycott2 polaction_idx3 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust kaepblm_interact, cluster(hidstatezip)

logit demonstrate2 polaction_idx3 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust kaepblm_interact, cluster(hidstatezip)

logit meeting2 polaction_idx3 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust kaepblm_interact, cluster(hidstatezip)

logit contact2 polaction_idx3 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust kaepblm_interact, cluster(hidstatezip)

logit donate2 polaction_idx3 blm_id Kaepnew2 pol_know pol_interest obama_therm linked_fate age south female college republican indep_other ideo church_att married own_home income_miss income_80K income_150K pol_trust kaepblm_interact, cluster(hidstatezip)

*[Results hold when graphing with index of participation earlier in life too...
*suggesting that Kaepernick approval really is working above and beyond past
*life political interest or engagement in actions beyoind voting!] 

